/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pl.butler.cezary.syncTool.storage.strategies;

/**
 * NOT THREAD SAFE
 * @author Czarek
 */
public class OnceATimeStrategy implements ISavingStrategy{
    private final int triesBeforeSave;
    private int counter;

    public OnceATimeStrategy(int triesBeforeSave) {
        this.triesBeforeSave = triesBeforeSave;
    }

    public boolean doSave() {
        return (++counter)%triesBeforeSave==0;
    }    
    
}
